<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>JBlog后台管理</title>

  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit">

  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp"/>
  <!-- 
  <link rel="icon" type="image/png" href="i/favicon.png">
  -->
  <!-- Amaze UI CSS -->
  <link rel="stylesheet" href="${rc.contextPath}/resources/amazeui/css/amazeui.min.css">
  <link rel="stylesheet" href="${rc.contextPath}/resources/css/app.css">
  <link rel="stylesheet" href="${rc.contextPath}/resources/editormd/css/editormd.min.css" />
  <link rel="stylesheet" href="${rc.contextPath}/resources/amazeui/css/amazeui.tagsinput.css" />
</head>
<body>
<div id="id-dimmer"><i class="am-icon-spinner am-icon-pulse am-icon-lg"></i></div>
<header data-am-widget="header" class="am-header am-header-default" style="position:fixed;background-color:#34495E;">
	<div class="am-header-title" style="margin-left:10px;text-align:left">
		JBlog 后台管理
	</div>
  <div class="am-header-right am-header-nav">
    <a href="/" target="_blank"> 
      <i class="am-header-icon am-icon-hand-o-right"></i>
    </a>
  </div>
</header>

<div class="am-g" style="height:100vh;padding-top:49px;">
  <div class="am-u-lg-2 am-u-md-3 am-hide-sm admin-menu mp0" style="height:100%;background-color:#1C2B36;">
    <ul class="mp0">
      <li class="openable">
        <div class="menu-label" id="menu-article">
          <span class="menu-icon"><i class="am-icon-fw am-icon-edit"></i></span>
          文章 Article
        </div>
        <ul>
          <li class="menu-label" url="/article/admin/add">添加文章</li>
          <li class="menu-label" url="/article/admin/list/page/1">文章列表</li>
          <li class="menu-label" url="/article/admin/trashbox/page/1">垃圾箱</li>
        </ul>
      </li>
      <li class="openable">
        <div class="menu-label" id="menu-mt">
          <span class="menu-icon"><i class="am-icon-fw am-icon-tag"></i></span>
          目录和标签
        </div>
        <ul class="hidden">
          <li class="menu-label">目录 Menu</li>
          <li class="menu-label">标签 Tag</li>
        </ul>
      </li>
      <li class="openable">
        <div class="menu-label" id="menu-comment">
          <span class="menu-icon"><i class="am-icon-fw am-icon-comment"></i></span>
          多说评论
        </div>
        <ul class="hidden">
          <li class="menu-label" url="/admin/duoshuo/comments">评论列表</li>
          <li class="menu-label" url="/admin/duoshuo/settings">功能设置</li>
          <li class="menu-label" url="/admin/duoshuo/analysis">分析统计</li>
        </ul>
      </li>
      <li class="menu-label" url="/admin/widgets">
        <div class="menu-label" id="menu-widgets"><span class="menu-icon"><i class="am-icon-fw am-icon-th"></i></span>
        插件管理
        </div>
      </li>
      <li class="openable">
        <div class="menu-label" id="menu-cog">
          <span class="menu-icon"><i class="am-icon-fw am-icon-cog"></i></span>
          系统设置
        </div>
        <ul class="hidden">
          <li class="menu-label" url="/admin/settings/statics">静态数据</li>
          <li class="menu-label" url="/admin/settings/account">帐号设置</li>
        </ul>
      </li>
      <li>
        <div class="menu-label" id="menu-quit">
          <form method="post" action="${rc.contextPath}/logout">
            <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
          </form>
          <span class="menu-icon"><i class="am-icon-fw am-icon-sign-out"></i></span>
          退出
        </div>
      </li>
    </ul>
  </div>
  <div id="id-main-frame" class="am-u-lg-10 am-u-md-9 am-u-sm-12 preety-scrool-bar" style="height:100%;background-color:#F5F5F5;"></div>
</div>
<div class="am-modal am-modal-confirm" tabindex="-1" id="id-modal-confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">JBlog</div>
    <div class="am-modal-bd" id="id-modal-title">
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn" data-am-modal-cancel>取消</span>
      <span class="am-modal-btn" data-am-modal-confirm>确定</span>
    </div>
  </div>
</div>
<script src="${rc.contextPath}/resources/js/jquery.min.js"></script>
<script src="${rc.contextPath}/resources/editormd/editormd.min.js"></script>
<script src="${rc.contextPath}/resources/amazeui/js/amazeui.min.js"></script>
<script src="${rc.contextPath}/resources/editormd/plugins/image-dialog-qiniu/image-dialog-qiniu.js"></script>
<script src="${rc.contextPath}/resources/js/jblog.js"></script>
<script type="text/javascript">
  /* 加载URL资源到功能区 */
  function fn_loadFrame(url) {
    $.get(url, function(data) {
      $("#id-main-frame").html(data);

      $(".menu-label[url]").each(function(){
        $(this).removeClass("active-label");
        if($(this).html() == $("#id-page-title").html())
          $(this).addClass("active-label");
      });
    });
  }

  function dimmer(flag){
    $("#id-dimmer").css("display",flag ? "block" : "none");
  }

  function fn_alert(title){
    this.title = title;
    this.show = function(callback){
      $("#id-modal-title").html(title);
      var modalWindow = $('#id-modal-confirm').modal({
        relatedTarget : {callback:callback},
        onConfirm: function(options) {
          this.relatedTarget.callback.call();
        }
      });
    };
  }

  $(function(){
    $(".openable>.menu-label").append('<span class="submenu-icon"><i class="am-icon-fw am-icon-angle-right"></i></span>');
    fn_loadFrame("/article/admin/list/page/1");

    $(".openable>.menu-label").click(function(){
      $(this).next("ul").slideToggle(100);
    });

    $(".menu-label[url]").click(function(){
      if($("#id-page-title").html() != $(this).html())
        fn_loadFrame($(this).attr("url"));
    });

    $("#menu-quit").bind("click",function(){
      $(this).find("form").submit();
    });
  });
</script>
</body>
</html>